import {CommonApi} from '@/api/equip/CommonApi.js'

export const GridEvent = {
  OptionData_taskTypeNo: [],
  OptionData_warehouseNo: [],
  OptionData_djhszt: [],

  getOptionData_taskNo: (xGrid) => {//获取管理单位：字典表
    CommonApi.queryDictData('EN_DEFECTS_SHEET_STATE').then(res => {
      if (xGrid) {
        let optionList = [
          {label: '请选择', value: ''}
        ]
        res.data.forEach((item) => {
          // console.log(item,'item.,,,');
          optionList.push({label: item.value, value: item.code})
        })
        const item = xGrid.getFormItems(4)
        item.itemRender.options = optionList
        GridEvent.OptionData_gldw = optionList;
      }
    }).catch(err => {
      console.log(err)
    })
  },
}
